﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Data;
using IToursDataService.Models;

namespace IToursDataService
{
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码和配置文件中的接口名“IDataService”。
    [ServiceContract]
    public interface IBaseInfo
    {
        #region 基础信息管理

        #region 获取国家表数据
        /// <summary>
        ///  获取国家表数据
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        DataTable GetCountryData();

        #endregion

        #region 更新国家表数据
        [OperationContract]
        string CreateCountryData(CountryEntity entity);

        int UpdateCountryData(CountryEntity entity);

        int DeleteCountryData(string countryId);
        #endregion

        #region 获取城市表数据
        /// <summary>
        ///  获取城市表数据
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        DataTable GetCityData();
        /// <summary>
        ///  根据中文名称获取城市表数据
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        DataTable GetCityDataByName(string name);
        /// <summary>
        /// 根据输入城市名称拼音获取城市数据
        /// </summary>
        /// <param name="cityPY"></param>
        /// <returns></returns>
        [OperationContract(Name = "PY")]
        DataTable GetCityData(string cityPY);

        #endregion

        #region 更新城市表数据
       [OperationContract]
        string CreateCityData(CityEntity entity);
        [OperationContract]
        int UpdateCityData(CityEntity entity);
        [OperationContract]
        int DeleteCityData(string cityId);

        #endregion

        #region 获取客户表数据
        /// <summary>
        ///  获取客户表数据
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        DataTable GetCustomerData();
        #endregion

        /// <summary>
        /// 检测是否存在同名ID
        /// </summary>
        /// <param name="customerId"></param>
        /// <returns>true存在，false不存在</returns>
        [OperationContract]
        bool CheckExistSameCustomerID(string customerId);

        #region 增加、删除、更新客户表数据

        [OperationContract]
        string CreateCustomerData(CustomerEntity entity);
        [OperationContract]
        int UpdateCustomerData(CustomerEntity entity);
        [OperationContract]
        int DeleteCustomerData(string customerId);
        #endregion

        #region 获取供应商信息

        [OperationContract(Name="b")]
        DataTable GetProviderData(string cityName, ProviderTypeEnum providerTypeEnum);

        /// <summary>
        /// 根据团计划获取计划中的供应商信息
        /// </summary>
        /// <param name="providerNamePY"></param>
        /// <returns></returns>
        [OperationContract]
        DataTable GetProviderDataForSchedule(string tourgroupId);
        [OperationContract(Name = "c")]
        DataTable GetProviderData(string providerNamePY);
        /// <summary>
        /// 获取供应商信息
        /// </summary>
        /// <param name="type">供应商类型</param>
        /// <returns></returns>
        [OperationContract(Name = "d")]
        DataTable GetProviderData(ProviderTypeEnum[] types);
        /// <summary>
        /// 判断是否是本地供应商
        /// </summary>
        /// <param name="providerId"></param>
        /// <returns></returns>
        [OperationContract]
        bool GetProviderForIsLocalProvider(string providerId);
        /// <summary>
        /// 判断是否是"旅行社"类型供应商
        /// </summary>
        /// <param name="providerId"></param>
        /// <returns></returns>
        [OperationContract]
        bool GetProviderForIsTravelProvider(string providerId);
        /// <summary>
        /// 获取供应商信息
        /// </summary>
        /// <param name="providerId">供应商ID</param>
        /// <returns></returns>
        [OperationContract]
        ProviderEntity GetProviderDataByID(string providerId);

        [OperationContract]
        DataTable GetProviderTableDataByID(string providerId);
        /// <summary>
        /// 根据城市拼音和供应商拼音获取供应商数据
        /// </summary>
        /// <param name="providerTypes"></param>
        /// <param name="cityPY"></param>
        /// <param name="providerNamePY"></param>
        /// <returns></returns>
        [OperationContract(Name="a")]
        DataTable GetProviderData(ProviderTypeEnum[] providerTypes, string cityPY, string providerNamePY);
        /// <summary>
        /// 根据ID获取供应商名称
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        string GetTeamProviderNameById(string providerid);
        [OperationContract]
        string GetProviderCityNameById(string providerid);
        /// <summary>
        /// 根据ID获取供应商类型
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        string GetProviderTypeById(int providerid);
        [OperationContract]
        bool ValidProviderLoginInfo(string username,string password);
        [OperationContract]
        string[] GetProviderNameAndID(string providerLoginUserName);
        #endregion

        #region 更新供应商基本信息

        [OperationContract]
        string CreateProviderData(ProviderEntity entity);
        [OperationContract]
        int UpdateProviderData(ProviderEntity entity);
        [OperationContract]
        bool UpdatePassword(string username, string newpassword);
        [OperationContract]
        int DeleteProviderData(string providerId);
        #endregion

        #region 获取导游表数据

        [OperationContract]
        object GetCiceroniPhoneById(string ciceroniId);
        
        /// <summary>
        /// 根据ID获取供应商名称
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        string GetCiceroniNameById(string ciceroniId);

        /// <summary>
        /// 获取全部导游信息
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        DataTable GetCiceroniData(string ownerProviderId);
        /// <summary>
        /// 从导游信息表中获取全部导游的语言信息
        /// </summary>
        /// <returns>只含‘CiceroniLanguage’字段的DataTable</returns>
        [OperationContract]
        DataTable GetCiceroniLanguageData();
        [OperationContract]
        DataTable GetCiceroniNameData(string language,string ownerProviderId);
        #endregion

        #region 更新导游表数据

        /// <summary>
        /// 创建一条导游信息
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        [OperationContract]
        string CreateCiceroniData(CiceroniEntity entity);
        /// <summary>
        /// 更新一条导游信息
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        [OperationContract]
        int UpdateCiceroniData(CiceroniEntity entity);
        /// <summary>
        /// 删除指定ID的导游信息
        /// </summary>
        /// <param name="ciceroniId"></param>
        /// <returns></returns>
        [OperationContract]
        int DeleteCiceroniData(string ciceroniId);

        #endregion

        #region 获取变更通知表数据
        /// <summary>
        ///  获取变更通知表数据
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        DataTable GetChangeNotifyData(string tourGroupId);
        /// <summary>
        /// 生成变更通知中‘计次数’
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        [OperationContract]
        string GetChangeNotifyMaxNumber(string tourGroupId);

        #endregion

        #region 更新变更通知表数据

        [OperationContract]
        string CreateChangeNotifyData(ChangeNotifyEntity entity);
        [OperationContract]
        int UpdateChangeNotifyData(ChangeNotifyEntity entity);
        [OperationContract]
        int DeleteChangeNotifyData(string changeNotifyId);
        #endregion

        #region 获取飞机航班基本信息

        /// <summary>
        /// 获取全部飞机航班信息
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        DataTable GetFlightData();
        /// <summary>
        /// 获取航班信息表
        /// </summary>
        /// <param name="StartCity"></param>
        /// <param name="EndCity"></param>
        /// <returns></returns>
        [OperationContract(Name = "GetFlightDataPY")]
        DataTable GetFlightData(string startCityPY, string endCityPY);
        #endregion

        #region 更新飞机航班基本信息

        [OperationContract]
        string CreateFlightData(FlightEntity entity);
        [OperationContract]
        int UpdateFlightData(FlightEntity entity);
        [OperationContract]
        int DeleteFlightData(string flightId);

        #endregion

        #region 获取火车列车时刻信息

        /// <summary>
        /// 获取全部列车时刻信息表
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        DataTable GetTrainData();
        /// <summary>
        /// 获取列车时刻信息表
        /// </summary>
        /// <param name="StartCity"></param>
        /// <param name="EndCity"></param>
        /// <returns></returns>
        [OperationContract(Name = "GetTrainDataPY")]
        DataTable GetTrainData(string startCityPY, string endCityPY);
        #endregion

        #region 更新火车列车时刻信息

        [OperationContract]
        string CreateTrainData(TrainEntity entity);
        [OperationContract]
        int UpdateTrainData(TrainEntity entity);
        [OperationContract]
        int DeleteTrainData(string trainId);
        #endregion

        #region 获取部门信息

        /// <summary>
        /// 根据部门ID获取部门信息
        /// </summary>
        /// <param name="departmentId">大于等于1获取相应部门信息，否则返回全部</param>
        /// <returns></returns>
        [OperationContract]
        DataTable GetDepartmentDataByDepartmentID(int departmentId);
        /// <summary>
        /// 根据部门全部信息
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        DataTable GetDepartmentData();
        /// <summary>
        /// 根据所属级别获取部门信息0总经理,1部门领导,2普通员工
        /// </summary>
        /// <param name="rankId"></param>
        /// <returns></returns>
        [OperationContract(Name = "GetDepartmentDataByRankId")]
        DataTable GetDepartmentData(int rankId);
        #endregion

        #region 更新部门信息

        [OperationContract]
        string CreateDepartmentData(DepartmentEntity entity);
        [OperationContract]
        int DeleteDepartmentData(string DepartmentID);

        #endregion

        #region 获取费用类别信息

        /// <summary>
        /// 生成新的ExpenseTypeID
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        int GetNewExpenseTypeID();
        /// <summary>
        /// 根据类别获取费用类型
        /// </summary>
        /// <param name="type">1为标准项，2为扩展项，其它值为全部</param>
        /// <returns></returns>
        [OperationContract]
        DataTable GetExpenseTypeData(int type);
        /// <summary>
        /// 根据费用类型ID获取费用类型
        /// </summary>
        /// <param name="tourgroupid"></param>
        /// <returns></returns>
        [OperationContract]
        string GetExpenseTypeNameByID(int expensetypeid);
        /// <summary>
        /// 通过费用表判断是否指定的费用类型是否已经被使用
        /// </summary>
        /// <param name="expenseTypeId"></param>
        /// <returns>true已经使用，false没被使用</returns>
        [OperationContract]
        bool GetExpenseTypeExistUsage(string expenseTypeId);
        
        #endregion

        #region 更新费用类别信息
        [OperationContract]
        int CreateExpenseTypeData(ExpenseTypeEntity entity);

        [OperationContract]
        int UpdateExpenseTypeData(ExpenseTypeEntity entity);
        [OperationContract]
        int DeleteExpenseTypeData(string expenseTypeId);
	    #endregion

        #endregion

        #region 基础服务信息管理

        #region 更新汽车服务信息

        [OperationContract]
        string CreateVehicleData(VehicleEntity entity);
        [OperationContract]
        int UpdateVehicleData(VehicleEntity entity);
        [OperationContract]
        int DeleteVehicleData(string vehicleId);
        
        #endregion

        #region 更新餐厅服务信息

        [OperationContract]
        string CreateRestaurantData(RestaurantEntity entity);
        [OperationContract]
        int UpdateRestaurantData(RestaurantEntity entity);
        [OperationContract]
        int DeleteRestaurantData(string restaurantId);

        #endregion

        #region 更新演出门票服务信息

        [OperationContract]
        string CreatePlayTicketData(PlayTicketEntity entity);
        [OperationContract]
        int UpdatePlayTicketData(PlayTicketEntity entity);
        [OperationContract]
        int DeletePlayTicketData(string PlayTicketID);

        #endregion

        #region 更新宾馆服务信息

        [OperationContract]
        string CreateHotelData(HotelEntity entity);
        [OperationContract]
        int UpdateHotelData(HotelEntity entity);
        [OperationContract]
        int DeleteHotelData(string HotelID);
        #endregion

        #region 更新旅行社服务信息

        [OperationContract]
        string CreateTravelAgentData(TravelAgentEntity entity);
        [OperationContract]
        int UpdateTravelAgentData(TravelAgentEntity entity);
        [OperationContract]
        int DeleteTravelAgentData(string TravelAgentID);
        #endregion

        #region 更新景点门票服务信息

        [OperationContract]
        string CreateParkTicketData(ParkTicketEntity entity);
        [OperationContract]
        int UpdateParkTicketData(ParkTicketEntity entity);
        [OperationContract]
        int DeleteParkTicketData(string ParkTicketID);

        #endregion

        #endregion    
    }
}
